package com.example.renshiguanli.mapper;

import com.example.renshiguanli.pojo.Empsalary;
import com.example.renshiguanli.pojo.Salary;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface EmpSalaryMapper {
//    查询所有
    List<Empsalary> findAll();
//    添加
    @Insert("insert into empsalary (id, eid, sid,sal)\n" +
            "        values (#{id}, #{eid},#{sid},#{sal})")
    void addEmpSalary(Empsalary empsalary);
//    根据id查询
    @Select("select * from empsalary where id=#{id}")
    Empsalary findById(Integer id);
//    修改
    @Update("  update empsalary\n" +
            "        set eid = #{eid},\n" +
            "            sid = #{sid},\n" +
            "            sal = #{sal}\n" +
            "        where id = #{id}")
    void update(Empsalary empsalary);
//    删除信息
    @Delete("delete * from empsalary where id=#{id}")
    void deleteEmpSalary(Integer id);
//    查找信息
    List<Empsalary> query(String name);
}
